package com.patrol.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.patrol.dao.FengXianDao;
import com.patrol.pojo.Fengxian;
import com.patrol.service.FengXianService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class FengXianServiceImpl implements FengXianService {
    @Resource
    private FengXianDao fengXianDao;

    @Override
    public boolean insert(Fengxian fengxian) {
        return 1 == fengXianDao.insert(fengxian);
    }

    @Override
    public boolean delete(int id) {
        return 1 == fengXianDao.deleteById(id);
    }

    @Override
    public boolean update(Fengxian fengxian) {
        return 1 == fengXianDao.updateById(fengxian);
    }

    @Override
    public Fengxian select(int id) {
        return fengXianDao.selectById(id);
    }

    @Override
    public Page<Fengxian> selectPage(long currentPage, long limit) {
        return fengXianDao.selectPage(new Page<>(currentPage, limit), null);
    }


}
